package com.yh.blog.domain;

import lombok.Data;
import lombok.ToString;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * 留言实体类
 */
@Data
@ToString
public class Message {

    private Integer messageId;
    private String Img;
    private String email;
    private String nickname;
    private String content;
    private Date create_time;
    private int parent_messageId;
    private boolean admin_message;

//    回复评论
    private List<Message> replyMessages = new ArrayList<>();

    private Message parentMessage;
    private String parentNickname;

    public String formateTime(Date date) {
        SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm");
        return df.format(date);
    }
}
